Opened 14 years ago

Closed 5 years ago

#246 closed enhancement (wontfix)

Make working directory a per-thread property

Reported by: Jiri Svoboda Owned by:
Priority: minor Milestone:
Component: helenos/lib/c Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

Currently the working directory is a property of the task as a whole (same as in POSIX). This is incompatible with multi-threaded applications.

I propose to change WD to be a thread(fibril)-local property.

Compatibility analysis: This will not affect single-threaded POSIX applications. This could only break multi-threaded POSIX applications that rely on setting WD in one thread and then accessing it in another. It could be fixed in the prospective POSIX compatibility layer, however.

Change History (7)

comment:1 by Jakub Jermář, 14 years ago

I am concerned about the possible complications this could cause given the way we use kernel threads - i.e. as execution units for fibrils.

comment:2 by Jakub Jermář, 14 years ago

Milestone: 0.5.00.5.1

comment:3 by Jiri Svoboda, 13 years ago

I don't quite follow. Can you elaborate on this and perhaps give an example?

comment:4 by Jakub Jermář, 13 years ago

This was a reaction to making it a per-thread property. As fibrils can move among threads, their cwd would change accordingly. If it was a per-fibril property, I don't see any problem.

comment:5 by Jakub Jermář, 13 years ago

Type: proposalenhancement

comment:6 by Jakub Jermář, 12 years ago

Milestone: 0.5.0

comment:7 by Jiri Svoboda, 5 years ago

Resolution: wontfix
Status: newclosed

I changed my mind. Global state is bad. Thread- or fibril-specific global state is even worse. If an application requires more fine control, it should specify the base directory explicitly.

Note: See TracTickets for help on using tickets.